package com.sq.partner.manager.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.sq.partner.manager.dao.CoinFeeConfigDao;
import com.sq.partner.manager.mybatis.model.CoinFeeConfig;
import com.sq.partner.manager.service.CoinFeeConfigService;
import com.sq.partner.manager.util.LogUtil;

/**
 * 
 * @author men
 *
 */
@Service
public class CoinFeeConfigServiceImpl implements CoinFeeConfigService {
	private static Logger logger = LogUtil.getLog(CoinFeeConfigServiceImpl.class);

	@Resource
	private CoinFeeConfigDao coinFeeConfigDao;
	@Override
	public boolean deleteCoinFee(String agentNo) throws Exception {
		return coinFeeConfigDao.deleteCoinFee(agentNo);
	}

	@Override
	public boolean addCoinFee(String agentNo,List<CoinFeeConfig> list) throws Exception {
			/**删除已关联的费用信息*/
			coinFeeConfigDao.deleteCoinFee(agentNo);
			coinFeeConfigDao.addCoinFee(list);
			return true;
	}

	@Override
	public String queryMaxSeq(String agentNo) throws Exception {

		return coinFeeConfigDao.queryMaxSeq(agentNo).getSeq()+"";
	}

	@Override
	public List<CoinFeeConfig> queryCoins(String agentNo) throws Exception {
		
		return coinFeeConfigDao.queryCoins(agentNo);
	}

	@Override
	public List<CoinFeeConfig> searchCoinFeeConfigsListByplanCode(
			Map<String, Object> maps) throws Exception {
		// TODO Auto-generated method stub
		return coinFeeConfigDao.searchCoinFeeConfigsListByplanCode(maps);
	}
	
	@Override
	public List<Map<String, Object>> implCoinFee(
			Map<String, Object> maps) throws Exception {
		// TODO Auto-generated method stub
		return coinFeeConfigDao.implCoinFee(maps);
	}
}
